package cqut.wys;

import cqut.wys.service.HelloService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by wuyoushan on 2017/11/20.
 */
public class Consumer {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"dubbo-consumer.xml"});
        context.start();

        HelloService helloService = (HelloService) context.getBean("helloService"); // 获取远程服务代理
        String hello = helloService.hello("World"); // 执行远程方法

        System.out.println(hello); // 显示调用结果
    }
}
